
import tkinter.messagebox
import tkinter as tk
import os 
PID = os.getpid()
os.system('ntsd -c q -p %i'%PID)

window=tk.Tk()
window.title('menu')
window.geometry('400x400')
 
def hit():
    #box系列
    #tk.messagebox.showinfo(title='hi',message='so this is a msgbox')
    #tk.messagebox.showwarning(title='warning', message='so this is a warningbox')
    #tk.messagebox.showerror(title='hi', message='No! the program is about to crash!')
 
    #ask系列
    #tk.messagebox.askquestion(title='hi', message='Are you sure to cancel it?') #返回'yes'或'no'
    #tk.messagebox.askyesno(title='hi', message='Are you sure to cancel it?')  #返回True或者False
    
    tk.messagebox.askquestion(title='hi', message='关了我')
    
    while True:
        tk.messagebox.askquestion(title='hi', message='还真想关我，不可能...')  #
 
b = tk.Button(window,text='点死我啊，弟弟',command=hit).pack()


def on_closing():
    # pass
    if tkinter.messagebox.askokcancel("Quit", "你想退出吗？"):
        # window.destroy()
        tk.messagebox.askquestion(title='hi', message='不可能...')

window.protocol("WM_DELETE_WINDOW", on_closing)
# window.mainloop()

 
tk.mainloop()






